package com.kgcx.common.controller;

import com.kgcx.common.utils.ApplicationUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import springfox.documentation.annotations.ApiIgnore;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @author 吴刚林
 * @date 2017/12/14
 */
@Controller
@ApiIgnore
public class IndexController extends BaseController {

    @RequestMapping("/")
    public String index(HttpServletRequest request, Map<String, Object> model) {
        model.put("applicationName", ApplicationUtils.getApplicationName());
        model.put("dbEnable", ApplicationUtils.containsBean("druidConfig"));
        model.put("swaggerEnable", ApplicationUtils.containsBean("swaggerConfig"));
        return "index";
    }

    @RequestMapping("/actuatorList")
    public String actuatorList(HttpServletRequest request, Map<String, Object> model) {
        model.put("applicationName", ApplicationUtils.getApplicationName());
        return "actuatorList";
    }
}
